package puzzle.core.tiles;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import puzzle.core.TileType;
import puzzle.core.tiles.SolidTile;

public class ImageTile extends SolidTile {
  
  protected Image image;
  
  public ImageTile(TileType t, Image i, Color bg) {
    super(t, bg);
    this.image = i;
  }
  
  public ImageTile(TileType t, Image i) {
    this(t, i, null);
  }
  
  public void render(Graphics g, int x, int y) {
    //renders background if color exists
    super.render(g, x, y);
    g.drawImage(image, x, y);
  }
}
